Eclipse Platform
Pre-release 3.0

org.eclipse.team.core.sync
Class LocalSyncElement

java.lang.Object
  extended byorg.eclipse.team.core.sync.LocalSyncElement
All Implemented Interfaces:
ILocalSyncElement
Direct Known Subclasses:
RemoteSyncElement

public abstract class LocalSyncElement
extends Object
implements ILocalSyncElement

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. A standard abstract class that provides implementations for ILocalSyncElement methods.

Since:
2.0

Field Summary
 
Fields inherited from interface org.eclipse.team.core.sync.ILocalSyncElement
ADDITION, AUTOMERGE_CONFLICT, CHANGE, CHANGE_MASK, CONFLICTING, DELETION, DIRECTION_MASK, GRANULARITY_CONTENTS, GRANULARITY_CONTENTS_IGNORE_WHITESPACE, GRANULARITY_TIMESTAMP, IN_SYNC, INCOMING, MANUAL_CONFLICT, OUTGOING, PSEUDO_CONFLICT
 
Constructor Summary
LocalSyncElement()
           
 
Method Summary
abstract  ILocalSyncElement create(IResource local, IRemoteResource base, Object data)
          Creates a client specific sync element from a local and base resources.
 boolean equals(Object other)
           
protected abstract  Object getData()
          Client data that is passed to every create() call.
 String getName()
          Answer a string that describes the simple name of the sync node, which is suitable for display to a user.
 int getSyncKind(int granularity, IProgressMonitor progress)
          Performs a synchronization calculation on the given element based on the local and base resources.
 boolean isContainer()
          Answer if the sync node is a container and may have children.
protected abstract  boolean isIgnored(IResource resource)
          Client can decide is a specific element should be ignored from this sync element's children.
 ILocalSyncElement[] members(IProgressMonitor monitor)
          Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.team.core.sync.ILocalSyncElement
getBase, getLocal
 

Constructor Detail

LocalSyncElement

public LocalSyncElement()
Method Detail

create

public abstract ILocalSyncElement create(IResource local,
                                         IRemoteResource base,
                                         Object data)
Creates a client specific sync element from a local and base resources. The base resource may be null and should be intialized by the client if available.

Parameters:
local - the local resource in the workbench. Will never be null.
base - the base resource, may me null.
data - client specific data.
Returns:
a client specific sync element.

getData

protected abstract Object getData()
Client data that is passed to every create() call.

Returns:
client specific data that will be passed to create.

isIgnored

protected abstract boolean isIgnored(IResource resource)
Client can decide is a specific element should be ignored from this sync element's children.

Parameters:
resource - the resource to be queried.
Returns:
true if this element should be ignored and not considered an immediate child of this element, and false otherwise.

getSyncKind

public int getSyncKind(int granularity,
                       IProgressMonitor progress)
Description copied from interface: ILocalSyncElement
Performs a synchronization calculation on the given element based on the local and base resources. Returns an integer describing the synchronization state of this element.

Specified by:
getSyncKind in interface ILocalSyncElement
Parameters:
granularity - the granularity at which the elements of this sync element should be compared. On of GRANULARITY_TIMESTAMP, or GRANULARITY_CONTENTS.
progress - a progress monitor to indicate the duration of the operation, or null if progress reporting is not required.
Returns:
int an integer describing the synchronization state of this element.

getName

public String getName()
Description copied from interface: ILocalSyncElement
Answer a string that describes the simple name of the sync node, which is suitable for display to a user. The name will be used in UI operations, so it is expected that implementations will cache this value.

Specified by:
getName in interface ILocalSyncElement
Returns:
String the simple name that identifies the resource within its parent container.

isContainer

public boolean isContainer()
Description copied from interface: ILocalSyncElement
Answer if the sync node is a container and may have children.

Specified by:
isContainer in interface ILocalSyncElement
Returns:
boolean true if the remote resource is a container, and false if it is not.

members

public ILocalSyncElement[] members(IProgressMonitor monitor)
                            throws TeamException
Description copied from interface: ILocalSyncElement
Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order. The returned sync nodes are a combination of the nodes represented by the sync element (e.g. local, base, remote).

Specified by:
members in interface ILocalSyncElement
Parameters:
monitor - a progress monitor to indicate the duration of the operation, or null if progress reporting is not required.
Returns:
ILocalSyncElement[] array of immediate children of this sync node.
Throws:
TeamException

equals

public boolean equals(Object other)

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.